home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-1.iso / utility / horst_2.zip / INSET.DOC < prev    next >
Text File  |  1995-12-18  |  1KB  |  32 lines

  1. ------------------------------------------------------------------------
  2. INSET     String input to variable              (c) 1994 Horst Schaeffer
  3. ------------------------------------------------------------------------
  4.  
  5. INSET is a simple string input tool for batch files.
  6.  
  7. Syntax:    INSET ["prompt"] varname [/U]
  8.  
  9. prompt     in "double" or 'single' Quotes
  10. varname    name of the environment variable
  11. /U         convert input to upper case
  12.  
  13. The optional prompt may include ANSI sequences for color and cursor.
  14. Example (replace "#" with ESC code):
  15.  
  16.     INSET "#[31;40;1mEnter file name: #[0;34;47m" FN
  17.  
  18. This will produce a bright red on black prompt, and the input will
  19. come blue on white.
  20.  
  21. The input length is returned as errorlevel.
  22.  
  23. Example:
  24.     INSET "Select Drive " DRV /U
  25.     if not errorlevel 1 set DRV=A           (no input: default)
  26.     if not errorlevel 2 set DRV=%DRV%:      (length<2, append ":")
  27.     ::...
  28.  
  29. Errorlevel 255 if syntax error or environment space full.
  30.  
  31. = 26 NOV 1994
  32.